package io.renren.po;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;

import java.io.Serializable;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 应用客户端用户
 *
 * @author levitian
 */
@TableName("user")
public class User implements Serializable {

    private static final long serialVersionUID = 8402219030787969823L;

    public User() {
        super();
        Date date = new Date();//获得系统时间
        String nowTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
        Timestamp goodsC_date = Timestamp.valueOf(nowTime);//把时间转换 
        this.createDate = goodsC_date;
        this.lastModifyTime = goodsC_date;
    }

    public User(BigInteger id, String username, String applicationId, String password, String wxOpenId, String wxUnionId,
                Timestamp createDate, Timestamp lastModifyTime) {
        super();
        this.id = id;
        this.username = username;
        this.applicationId = applicationId;
        this.password = password;
        this.wxOpenId = wxOpenId;
        this.wxUnionId = wxUnionId;
        this.createDate = createDate;
        this.lastModifyTime = lastModifyTime;
    }

    /**
     * ID
     */
    @TableId
    private BigInteger id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 注册用户时绑定的应用id
     */
    private String applicationId;

    /**
     * 密码
     */
    private String password;

    /**
     * 微信OpenId
     */
    private String wxOpenId;

    /**
     * 微信UnionId
     */
    private String wxUnionId;

    private String nickName;

    private String wxAvatar;
    /**
     * 创建时间
     */
    private Timestamp createDate;

    /**
     * 最后一次更改时间
     */
    private Timestamp lastModifyTime;

    public BigInteger getId() {
        return id;
    }

    public void setId(BigInteger id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getApplicationId() {
        return applicationId;
    }

    public void setApplicationId(String applicationId) {
        this.applicationId = applicationId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getWxOpenId() {
        return wxOpenId;
    }

    public void setWxOpenId(String wxOpenId) {
        this.wxOpenId = wxOpenId;
    }

    public String getWxUnionId() {
        return wxUnionId;
    }

    public void setWxUnionId(String wxUnionId) {
        this.wxUnionId = wxUnionId;
    }

    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    public Timestamp getLastModifyTime() {
        return lastModifyTime;
    }

    public void setLastModifyTime(Timestamp lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getWxAvatar() {
        return wxAvatar;
    }

    public void setWxAvatar(String wxAvatar) {
        this.wxAvatar = wxAvatar;
    }

}
